<%-- 
    Document   : login
    Created on : 2019-9-24, 11:09:50
    Author     : 10592
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link type="text/css" rel="stylesheet" href="css/style.css" />
    </head>
    <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
    <script type="text/javascript" >
    $(function(){

            $("#errorpwd").css("display", "none");
            $("#errorname").css("display", "none");
            $(".input-btn").click(function () {
                 
                 $.get("Login.html?flag=1",
                 {userName: $("input[name='userName']").val(), passWord: $("input[name='passWord']").val()},
                 function(result,status){
                    alert(result);
                     if(result=="success"){
                         location.href = "index.html";
                     }else if(result=="用户不存在"){
                          $("#errorname").css("display", "inline");
                     }
                 }
                 );

             });
        });
        
            

       
          
    </script>
 
    <body>
        <div id="header" class="wrap">
            <div id="logo">网上书城</div>
            <div id="navbar">
                <form method="get" name="search" action="">
                    搜索：<input class="input-text" type="text" name="keywords" /><input class="input-btn" type="submit" name="submit" value="" />
                </form>
            </div>
        </div>
        <div id="login">
            <h2>用户登陆</h2>
            <dl>
                <dt>用户名：</dt>
                <dd><input class="input-text" type="text" name="userName" /><span id="errorname" >当前用户不存在！</span></dd>
                <dt>密　码：</dt>
                <dd><input class="input-text" type="password" name="passWord" /><span id="errorpwd">密码过于简单！</span></dd>
                <dt></dt>
                <dd class="button"><input class="input-btn" type="submit" name="submit" value="" /><input class="input-reg" type="button" name="register" value="" onclick="window.location='register.jsp';" /></dd>
            </dl>
        </div>
        <div id="footer" class="wrap">
            网上书城 &copy; 版权所有

        </div>
    </body>
</html>
